$INCLUDE: 'C:\FG\FASTGRAF.FI'

      PROGRAM MAIN

      INTEGER WIDTH, HEIGHT
      PARAMETER (WIDTH = 20, HEIGHT = 20)

      INTEGER HANDLE, OLD_MODE, STATUS, X
      INTEGER FG_GETMODE, FG_VBALLOC, FG_VBOPEN

      CALL FG_INITPM
      OLD_MODE = FG_GETMODE()
      CALL FG_SETMODE(19)
      CALL FG_VBINIT

      CALL FG_SETCOLOR(15)
      CALL FG_RECT(0,WIDTH-1,0,HEIGHT-1)
      CALL FG_SETCOLOR(9)
      CALL FG_RECT(1,WIDTH-2,1,HEIGHT-2)
      CALL FG_WAITKEY

      HANDLE = FG_VBALLOC(WIDTH,HEIGHT)
      STATUS = FG_VBOPEN(HANDLE)
      CALL FG_VBCUT(0,WIDTH-1,0,HEIGHT-1,0,HEIGHT-1)

      DO 10 X = 0,320-WIDTH,WIDTH
         CALL FG_VBPASTE(0,WIDTH-1,0,HEIGHT-1,X,199)
10    CONTINUE
      CALL FG_WAITKEY

      CALL FG_VBCLOSE
      CALL FG_VBFREE(HANDLE)
      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
      END
